<template>
  <el-card class="box-card">
    <XForm ref="form" :fieldList="fieldList" :options="formOption" :formData="info.sales_coefficient" :originOption="originOption">
      <template #appendSlot>天</template>
    </XForm>
    <div>说明：系统预估销量=销量系数*加权日平均销量，各销售系数为空时，默认为1。</div>
  </el-card>
</template>

<script setup>
import { onMounted, ref, toRefs } from "vue"

import XForm from "@/components/XForm/index.vue"
const props = defineProps({
  info: { type: Object, default: () => {} },
})
//获取下拉数据
onMounted(() => {})
const form = ref()
const originOption = ref({
  platform: [
    { label: "SKU", value: "products.sku" },
    { label: "自定SKU", value: "products.custom_sku" },
    { label: "ASIN", value: "products.asin" },
  ],
})
const formOption = ref({
  inline: true,
  labelWidth: "160px",
})

const publicStyle = { style: { width: "300px" } }
const fieldList = ref([
  { type: "title", label: "销量系数设置" },
  { field: "week_month_rise", label: "周上升且月上升", ...publicStyle },
  { field: "month_decline", label: "周上升且月下降", ...publicStyle },
  { field: "month_rise", label: "周下降且月上升", ...publicStyle },
  { field: "week_month_decline", label: "周下降且月下降", ...publicStyle },
  { field: "month_flat", label: "周持平或月持平", ...publicStyle },
])
defineExpose({ form })
</script>
<style lang="scss" scoped>
.box-card {
  margin-bottom: 8px;
}
.inline-form {
  .el-input {
    width: 60px;
  }
}
</style>
